export default {
    mounted(el:HTMLImageElement) {
        let img = el
        if(img){
            const imgSrc = img.src
            img.src = ''
            //观察者
            const observer = new IntersectionObserver(([{isIntersecting}])=>{
                if(isIntersecting){
                    img!.src = imgSrc
                    observer.unobserve(img!)
                }
            })
            observer.observe(img)
        }

    }
}
